<template>
	<view class="content">
		<view class="content-bg">
			<u-navbar bgColor="transparent" titleStyle="color:#fff" title="我的工厂" leftIconColor="#fff" :autoBack="true"
				:placeholder="false">
			</u-navbar>
			<view class="content-box">
				<view style="height: 6vh;"></view>
				<view class="head">
					<view :class="item.show == true?'activity':'stillness'" class="head-item"
						v-for="(item,index) in headList" :key="index" @click="headTab(index)">
						{{item.text}}
					</view>
				</view>
				<view class="factory">
					<view class="factory-item" v-for="(item,index) in 3" :key="index">
						<view class="new">进行中</view>
						<view class="item-top">
							<image src="/static/factory/factory-img.png" mode=""></image>
							<view class="top-right">
								<view class="right-title">
									二号工厂
								</view>
								<view class="refund">
									<view class="refund-item way">
										返款方式
									</view>
									<view class="refund-item">
										每日返本返息
									</view>
								</view>
							</view>
						</view>
						<view class="time">
							<view>购买时间</view>
							<view class="time-num">2024-05-13</view>
						</view>
						<view class="time">
							<view>到期时间</view>
							<view class="time-num">2024-05-14</view>
						</view>
						<view class="item-num">
							<view class="num">
								<view>
									1<text>天</text>
								</view>
								<view class="num-text">
									工作周期
								</view>
							</view>
							<view class="num">
								<view>
									1.00%
								</view>
								<view class="num-text">
								云矿石利率
								</view>
							</view>
							<view class="num">
								<view>
									1
								</view>
								<view class="num-text">
									到期云矿石
								</view>
							</view>
						</view>
						<view class="work">
							<view>
								实付云矿石
							</view>
							<view class="work-price">
								100.00
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				headList: [{
						text: '正在工作',
						show: true
					},
					{
						text: '结束工作',
						show: false
					}
				]
			}
		},
		onLoad() {

		},
		methods: {
			headTab(index) {
				this.headList.map((item) => {
					item.show = false
				})
				this.headList[index].show = true
			}
		}
	}
</script>

<style>
	page {
		background: #1e0c4f;
	}
</style>
<style lang="scss" scoped>
	.content {
		.content-bg {
			background-image: url('../../../static/factory/head-bg.png');
			background-repeat: no-repeat;
			background-size: 100% 544rpx;

			.content-box {
				padding: 30rpx;

				.head {
					display: flex;
					justify-content: space-around;
					text-align: center;

					.head-item {
						width: 331rpx;
						font-size: 28rpx;
						font-weight: 600;
						border: 1rpx solid transparent;
						padding: 30rpx;
						border-radius: 30rpx;
					}

					.activity {
						color: #F643D1;
						background-color: rgba(246, 67, 209, 0.16);
						border: 1rpx solid #F643D1;
					}

					.stillness {
						background-color: rgba(255, 255, 255, .05);
						color: #fff;
					}
				}
				.factory {
					.factory-item {
						position: relative;
						margin-top: 30rpx;
						background-color: rgba(255, 255, 255, .05);
						padding: 30rpx;
						border-radius: 20rpx;
				
						.new {
							position: absolute;
							right: 0;
							top: 0;
							background-color: rgba(255, 255, 255, .05);
							padding: 10rpx 15rpx;
							border-top-right-radius: 20rpx;
							border-bottom-left-radius: 20rpx;
							color: #B786FF;
							font-size: 26rpx;
						}
				
						.item-top {
							display: flex;
							align-items: center;
				
							image {
								width: 110rpx;
								height: 110rpx;
							}
				
							.top-right {
								color: #FFFFFF;
								margin-left: 20rpx;
				
								.right-title {
									font-size: 32rpx;
									font-weight: 600;
								}
				
								.refund {
									margin-top: 20rpx;
									display: flex;
									font-size: 24rpx;
									background-color: rgba(255, 255, 255, .05);
									border-radius: 10rpx;
									overflow: hidden;
				
									.refund-item {
										padding: 10rpx 15rpx;
									}
				
									.way {
										background: linear-gradient(90deg, #513AFD 0%, #F42FF9 54%, #F85B9F 100%);
									}
								}
							}
						}
				
						.item-num {
							display: flex;
							justify-content: space-around;
							padding: 20rpx;
							background-color: rgba(255, 255, 255, .05);
							border-radius: 20rpx;
							color: #fff;
							margin-top: 30rpx;
							text-align: center;
							.num {
								font-size: 36rpx;
								font-weight: 600;
							}
							.num-text {
								color: #999;
								font-size: 24rpx;
								margin-top: 15rpx;
							}
						}
						.work {
							display: flex;
							justify-content: space-between;
							align-items: center;
							margin-top: 30rpx;
							color: #999;
							font-size: 24rpx;
							.work-price {
								color: #F53CDE;
								font-size: 40rpx;
								font-weight: 600;
							}
						}
						.time {
							font-size: 24rpx;
							color: #999;
							display: flex;
							justify-content: space-between;
							align-items: center;
							margin-top: 20rpx;
							.time-num {
								color: #fff;
								font-weight: 600;
							}
						}
					}
				}
			}
		}
	}
</style>